package com.gw.smscheck.service.sys.impl;

import java.util.List;

import com.gw.smscheck.entity.sys.DataDictionary;
import com.gw.smscheck.entity.sys.Menu;
import com.gw.smscheck.entity.sys.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.gw.smscheck.dao.sys.SysRoleMapper;
import com.gw.smscheck.entity.sys.SysRole;
import com.gw.smscheck.service.sys.SysRoleService;
@Service
public class SysRoleServiceImpl implements SysRoleService {
	@Autowired
	private SysRoleMapper sysRoleMapper;
	@Override
	public Integer add(SysRole sysRole) {
		return sysRoleMapper.add(sysRole);
	}
	@Override
	public List<SysRole> findAll() {
		return sysRoleMapper.findAll();
	}
	@Override
	public PageInfo<SysRole> pageSelect(SysRole dto) {
		PageHelper.startPage(dto.getPage(), dto.getRows(), "create_time desc");// 排序
		List<SysRole> resultList = sysRoleMapper.pageSelect(dto);
		PageInfo<SysRole> pageInfo = new PageInfo<>(resultList);
		return pageInfo;
	}
	@Override
	public SysRole findById(Integer dto) {
		return sysRoleMapper.findById(dto);
	}
	@Override
	public Integer update(SysRole sysRole) {
		return sysRoleMapper.update(sysRole);
	}
	/**
	 * 删除
	 * @param
	 * @return
	 */
	@Override
	public Integer delById(SysRole sysRole) {
		return sysRoleMapper.delById(sysRole);
	}
}

